import request from '@/utils/request'

export function get(url, query) {
    return request({
        url: url,
        method: 'get',
        params: query
    })
    /*return res.then(d=>{
        if(d.code!=0){
            throw new Error(d.message);
        }
        d.pageInfo = {
            total:d.total,
            currentPage:d.currentPage,
            pages:d.pages
        }
    })*/
}

export function post(url, formData={}) {
    return request({
        url: url,
        method: 'post',
        data:formData
    })
}

export function put(url, params={}) {
    return request({
        url: url,
        method: 'put',
        data:params
    })
}

export function del(url, params={}) {
    return request({
        url: url,
        method: 'delete',
        data:params
    })
}
